package com.sfeir.contacts.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.sfeir.contacts.dao.ContactDao;
import com.sfeir.contacts.entity.Contact;

public class ContactServiceImpl implements ContactService {

	@Autowired
	private ContactDao contactDao;
	
	@Override
	public boolean verifyEmailArobase() {
		
		List<Contact> allContacts = contactDao.findAll();
		boolean flag = false;
		for (Contact contact : allContacts) {
			if ( !contact.getEmail().contains("@")) {
				flag = true;
				break;
			}
		}
		return flag;
	}

}
